package br.com.pontov;

import br.com.pontov.R;
import android.app.Activity;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;

public class AndPongActivity extends Activity {
    /** Called when the activity is first created. */
	
	
	private GameView gameView;
	private Handler guiRefresher;
	
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        
        gameView = (GameView) findViewById(R.id.gameView);
        guiRefresher = new Handler(){
            public void handleMessage(Message msg){
                if(msg.what == 10001)//Numero arbitrario
                    gameView.invalidate();
                super.handleMessage(msg);
            }
        };
        
        gameView.setCallbackHandler(guiRefresher);
        
        Thread t = new Thread(gameView);
        t.setDaemon(true);
        t.start();
    }
}